<template>
	<div>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="发货Id:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.looking" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="采购成本:" :label-width="formLabelWidth">
						<el-input v-model="list.priceRusCost" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="物品名称:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.name" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="物流状态:" :label-width="formLabelWidth">
						<el-select v-model="list.state" placeholder="下拉选择">
						 <el-option key="" label="全部" value=""></el-option>
						  <el-option v-for="item in optionwp" :key="item.id" :label="item.name" :value="item.id">
						  </el-option>
						</el-select>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="物品类型:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.typeName" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="备注:" :label-width="formLabelWidth">
						<el-input v-model="list.remarkAdmin" type="textarea" :autosize="{ minRows: 3, maxRows: 6 }"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="品质:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.qualityName" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="预览图:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.img" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="用户邮箱:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.email" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="用户昵称:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.nickname" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="当前交易链接:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.steamTradeUrlCurrent" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="发货交易链接:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.steamTradeUrl" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="创建时间:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.cooling" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row :span="16" class="row-bg" style="margin-top: 2vh;">
			<el-col :span="12">
				<el-form class="demo-form-inline">
					<el-form-item label="当前售价:" :label-width="formLabelWidth">
						<el-input :disabled="true" v-model="list.priceRusCost" autocomplete="off" placeholder="请输入"></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<div style="margin-top: 10vh;">
			<div slot="footer" class="dialog-footer" style="margin-left: 75%;width: 200px;">
				<el-button @click="clickRemovesDialogForm()">取 消</el-button>
				<el-button type="primary" @click="RemovesDialogForm()">确 定</el-button>
			</div>
		</div>
	</div>
</template>

<script>
	import api from '@/api/PurchaseDelivery/index.js'
	export default {
		props: ["parentData"],
		data() {
			return {
				list: [],
				formLabelWidth: "100px",
				optionwp:''
			}
		},
		mounted() {
			this.list = this.parentData
			console.log(this.list)
			this.$axios.post(`${api}/gamemall/deliveryStatus/get`,{
				"state": 1,
				"type": 1
			}).then(res => {
					this.optionwp = res.data
					console.log(res.data)
				})
				.catch(err => {
					// this.$message({
					// 	message: '数据异常',
					// 	type: 'warning'
					// })
				})
		},
		methods: {
			clickRemovesDialogForm() {
				this.$emit("DialogForm", false)
			},
			RemovesDialogForm() {
				this.$axios.post(`${api}/gamemall/trade/update`, {
						"id": this.list.id,
						"priceRusCost": this.list.priceRusCost,
						"state": this.list.state,
						"remarkAdmin": this.list.remarkAdmin
					}).then(res => {
						console.log(res)
						if(res.code == 200) {
							this.$message({
								message: '修改成功',
								type: 'warning'
							})
							this.clickRemovesDialogForm()
						}
						if (res.code == 500) {
							// this.$message({
							// 	message: '修改失败',
							// 	type: 'warning'
							// })
						}
					})
					.catch(err => {
						// this.$message({
						// 	message: '数据异常',
						// 	type: 'warning'
						// })
					})
			}
		}
	}
</script>

<style>
</style>
